﻿<template>
  <div class="kaoshi-container">
    <el-row class="row-con">
      <el-col :span="24" v-for="kaosheng in tableData">
        <el-card class="card">
          <template #header>
            <div class="card-header">
              <span>{{ kaosheng.kaoshiIdName }}</span>
            </div>
          </template>
          <div class="text item">
            <span>试场号：{{ kaosheng.shiChangNum }}</span>
          </div>
          <div class="text item">
            <span>试场地址：{{ kaosheng.address1 }}</span>
          </div>
          <div class="text item">
            <span>座位号：{{ kaosheng.zuoweiHao }}</span>
          </div>
          <div class="text item">
            <span>准考证号：{{ kaosheng.zhunkaoZhenghao }}</span>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-pagination
				v-model:currentPage="tableParams.page"
				v-model:page-size="tableParams.pageSize"
				:total="tableParams.total"
				:page-sizes="[3,10, 20, 50, 100, 200, 500]"
				small=""
				background=""
				@size-change="handleSizeChange"
				@current-change="handleCurrentChange"
				layout="total, sizes, prev, pager, next, jumper"
	    />
  </div>
</template>

<script lang="ts" setup="" name="kaoshi">
  import { ref } from "vue";
  import { ElMessageBox, ElMessage } from "element-plus";
  import { auth } from '/@/utils/authFunction';
  import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
  import { formatDate } from '/@/utils/formatTime';

  // 推荐设置操作 width 为 200

  import { pageMyKaoshi } from '/@/api/main/myKaoshi';

  const showAdvanceQueryUI = ref(false);
  const printDialogRef = ref();
  const editDialogRef = ref();
  const kaoshiXuekeDialogRef = ref();
  const shichangDialogRef = ref();
  const kaoshengDialogRef = ref();
  const loading = ref(false);
  const tableData = ref<any>([]);
  const queryParams = ref<any>({});
  const tableParams = ref({
    page: 1,
    pageSize: 10,
    total: 0,
  });

  const printKaoshiTitle = ref("");
  const editKaoshiTitle = ref("");
  const kaoshiXuekeTitle = ref("");
  const kaoshiId = ref(0);
  

  // 改变高级查询的控件显示状态
  const changeAdvanceQueryUI = () => {
    showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
  }
  

  // 查询操作
  const handleQuery = async () => {
    loading.value = true;
    var res = await pageMyKaoshi(Object.assign(queryParams.value, tableParams.value));
    tableData.value = res.data.result?.items ?? [];
    tableParams.value.total = res.data.result?.total;
    loading.value = false;
  };

  // 改变页面容量
  const handleSizeChange = (val: number) => {
    tableParams.value.pageSize = val;
    handleQuery();
  };

  // 改变页码序号
  const handleCurrentChange = (val: number) => {
    tableParams.value.page = val;
    handleQuery();
  };
  
  handleQuery();
</script>
<style scoped>
:deep(.el-ipnut),
:deep(.el-select),
:deep(.el-input-number) {
	width: 100%;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.row-con{
  display: flex;
  flex-flow: row wrap;
}
.row-con .card{
  margin-top: 18px;
  height: 100%;
  width: 100%;
}
</style>

